<?php $this->_extends('_layouts/main_layout'); ?>
<?php $this->_block('title'); ?>
<?php echo "tokeninfo"; ?>
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>
<div id="content" class="box">
	<h1>Tokeninfo</h1>
	<table class="full-size">
		<tbody>
			<tr>
				<th>Uid</th>
				<th>Total tokens</th>
				<th>Site</th>
			</tr>
			<?php $cashdft = 0; 
				  $cashduser = (int)(count($cashdtokeninfo)/4)+1;
				  for($i=0; $i<$cashduser; $i++): ?>
				<?php foreach($cashddailytokeninfo as $ctif):
						if($ctif['user_id'] == $cashdtokeninfo[$i]['user_id'] && $ctif['rc'] >= $ctif['uc'] && $ctif['rc'] <= $ctif['uc'] + 60*60*24*7):
							$cashdft += $ctif['token'];
						endif;
					  endforeach; ?>
				<tr>
					<td><?php echo $cashdtokeninfo[$i]['user_id']; ?></td>
					<td><?php echo $cashdtokeninfo[$i]['tokens']; ?></td>
					<td>cashdazzle.com</td>
				</tr>
			<?php endfor; ?>
			
			
			
			<?php $lalaft = 0;
				  $lalauser = (int)(count($lalatokeninfo)/4)+1;
				  for($i=0; $i<$lalauser; $i++): ?>
				<?php foreach($laladailytokeninfo as $ltif):
						if($ltif['user_id'] == $lalatokeninfo[$i]['user_id'] && $ltif['rc'] >= $ltif['uc'] && $ltif['rc'] <= $ltif['uc'] + 60*60*24*7):
							$lalaft += $ltif['token'];
						endif;
					  endforeach; ?>
				<tr>
					<td><?php echo $lalatokeninfo[$i]['user_id']; ?></td>
					<td><?php echo $lalatokeninfo[$i]['tokens']; ?></td>
					<td>lalaloot.com</td>
				</tr>
			<?php endfor; ?>
		</tbody>
	</table>
	
	<table class="full-size">
		<tbody>
			<tr>
				<th>1st Week tokens/above users</th>
				<th>Site</th>
			</tr>
			<tr>
				<td><?php echo util::divide($cashdft, $cashduser, 2); ?></td>
				<td>Cashdazzle.com</td>
			</tr>
			<tr>
				<td><?php echo util::divide($lalaft, $lalauser, 2); ?></td>
				<td>Lalaloot.com</td>
			</tr>
		</tbody>
	</table>
</div>
<?php $this->_endblock(); ?>